import request from "@/utils/request";
//审批管理列表
export function fetchRoleGroupList(query) {
    return request({
        url: "/dmp-flowable/api/dmpFlow/query/page",
        method: "get",
        params: query
    });
}
export function fetchDepartmentList(query) {
    return request({
        url: "/system/departmentlist",
        method: "get",
        params: query
    });
}
export function deleteApproveTemplate(query) {
    return request({
        url: "/system/departmentlist",
        method: "get",
        params: query
    });
}
export function saveApproveTemplate(query) {
    if (query.id) {
        return request({
            url: "/dmp-flowable/api/dmpFlow/save",
            method: "post",
            data: query
        });
    } else {
        return request({
            url: "/dmp-flowable/api/dmpFlow/save",
            method: "post",
            data: query
        });
    }

}
//根据id删除审批模板
export function delApproveTemplate(query) {
    return request({
        url: "/dmp-flowable/api/dmpFlow/deleteById/" + query,
        method: "delete"
            //  params: query
    });
}
//组织架构管理----------------------------------------------------//
export function fetchList(query) {
    return request({
        url: "/user/api/positions/query/page",
        method: "get",
        params: query
    });
}
//保存部门信息
export function saveDepartmentInfo(query) {
    if (query.isAdd == 2) { //1为新增 2 为更名
        return request({
            url: "/organization/api/organization",
            method: "put",
            data: query
        })
    } else {
        return request({
            url: "/organization/api/organization",
            method: "post",
            data: query
        })
    };
}
//保存职位信息
export function saveDeviceInfo(query) {
    if (query.id) {
        return request({
            url: "/user/api/positions",
            method: "put",
            data: query
        });
    } else {
        return request({
            url: "/user/api/positions",
            method: "post",
            data: query
        });
    }
}
//部门排序
export function sortDepartmentInfo(query) {
    return request({
        url: " /organization/api/organization/order",
        method: "put",
        data: query
    });
}
//设备详细信息
export function fetchDetailInfo(query) {
    return request({
        url: "/device/api/device/query/" + query,
        method: "get"
    });
}
//导出
export function exportFile(params) {
    return request({
        url: "/device/api/device/exportExcel",
        method: "get"
    });
}
//下载批量导入模板

export function downloadTemplete(query) {
    return request({
        url: "/minio/minio/outSideChain",
        method: "get",
        params: query
    });
}
//删除台账
export function deleteDeviceInfo(query) {
    return request({
        url: "/user/api/positions/" + query,
        method: "delete"
            //data: query
    });
}

//删除部门
export function deleteOrgInfo(query) {
    return request({
        url: "/organization/api/organization/" + query,
        method: "delete"
            //data: query
    });
}